package org.zoomdev.zoom.dao.adapters.parameter;

import org.zoomdev.zoom.dao.adapters.ParameterAdapter;

import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Time;
import java.time.LocalTime;

// Java 8 LocalTime类型适配器
public class LocalTimeParameterAdapter implements ParameterAdapter<LocalTime> {

    @Override
    public void setNonnullParameter(PreparedStatement ps, int index, LocalTime data) throws SQLException {
        ps.setTime(index, Time.valueOf(data));
    }
}
